package cfca.paperless.client.servlet.heartBeat;

import cfca.paperless.client.servlet.PaperlessClient;
import cfca.paperless.client.servlet.PaperlessConfig;
import cfca.paperless.client.util.StringUtil;

/**
 * 
 * Modify Information:
 *	@Description 测试心跳检测接口
 * 	@Author  Dell
 *	@Date   2018年4月24日
 *	@CodeReviewer TODO
 * 
 *              
 * 
 */
public class TestHeartBeat {

	public static void main(String[] args) throws Exception {
		PaperlessClient client=new PaperlessClient(PaperlessConfig.heartUrl,10000, 60000);
		String operatorCode=PaperlessConfig.operatorCode;
		//调用无纸化服务，返回200代表成功
		String res=client.heartBeat(operatorCode);
		String code=StringUtil.getNodeText(res,"Code");
		if(code.equals("200")){
			System.out.println("无纸化服务正常");
		}else if(code.equals("500")){
			
			System.out.println("无纸化服务异常");
		}else{
			System.out.println(res);
		}
		

	}

}

